from OpenGL.GL import *
from OpenGL.GLUT import *

from common.terrain import Block
from common.doodads import AbstractDoodad

class NandocariumMine(AbstractDoodad):
	"""
	Nandocarium mine!
	"""
	
	SIZE = [2, 2]
	
	def __init__(self, block, quantity=10000):
		super(NandocariumMine, self).__init__(NandocariumMine.SIZE, block)
		
		self.side = Block.SIZE * 0.5
		self.quantity = quantity
		
	def render(self, alpha=None):
		if alpha is None:
			glColor(0.8, 0.9, 1.0)
		else:
			glColor(0.8, 0.9, 1.0, alpha)
		glPushMatrix()
		glTranslate(*self.middle)
		
		glTranslate(-self.side, self.side, -0.5 * self.side)
		glutSolidSphere(self.side, 4, 4)
		
		glTranslate(0.5 * self.side, -1.5 * self.side, 0.5 * self.side)
		glutSolidSphere(0.7 * self.side, 4, 4)
		
		glTranslate(0.5 * self.side, self.side, -0.5 * self.side)
		glutSolidSphere(1.5 * self.side, 6, 6)
		
		glPopMatrix()
		
	def render_picking(self):
		pass